Ext.override(Ext.LoadMask, {
	onHide: function() { this.callParent(); }
});
// bo Ext.Loader to singleton

/*/// KURWA PIERDOLONA WDUPE JEBANA MAcccccc
Ext.apply(Ext.Loader,{
	
	loadScriptFile: function(url, onLoad, onError, scope, synchronous) {
		var params = this.getConfig('extraParams');			
		if(params){
			if(!Ext.isString(params))params = Ext.Object.toQueryString(params);
		}
		
        var me = this,
            noCacheUrl = url + (
            	this.getConfig('disableCaching') ? 
            		('?' + this.getConfig('disableCachingParam') + '=' + Ext.Date.now()) : 
            		(params ? '?'+params :'')
            ),
            fileName = url.split('/').pop(),
            isCrossOriginRestricted = false,
            xhr, status, onScriptError;

        scope = scope || this;

        this.isLoading = true;

        if (!synchronous) {
            onScriptError = function() {
                onError.call(scope, "Failed loading '" + url + "', please verify that the file exists", synchronous);
            };

            if (!Ext.isReady && Ext.onDocumentReady) {
                Ext.onDocumentReady(function() {
                    me.injectScriptElement(noCacheUrl, onLoad, onScriptError, scope);
                });
            }
            else {
                this.injectScriptElement(noCacheUrl, onLoad, onScriptError, scope);
            }
        }
        else {
            if (typeof XMLHttpRequest !== 'undefined') {
                xhr = new XMLHttpRequest();
            } else {
                xhr = new ActiveXObject('Microsoft.XMLHTTP');
            }

            try {
                xhr.open('GET', noCacheUrl, false);
                xhr.send(null);
            } catch (e) {
                isCrossOriginRestricted = true;
            }

            status = (xhr.status === 1223) ? 204 : xhr.status;

            if (!isCrossOriginRestricted) {
                isCrossOriginRestricted = (status === 0);
            }

            if (isCrossOriginRestricted
            //<if isNonBrowser>
            && !isPhantomJS
            //</if>
            ) {
                onError.call(this, "Failed loading synchronously via XHR: '" + url + "'; It's likely that the file is either " +
                                   "being loaded from a different domain or from the local file system whereby cross origin " +
                                   "requests are not allowed due to security reasons. Use asynchronous loading with " +
                                   "Ext.require instead.", synchronous);
            }
            else if (status >= 200 && status < 300
            //<if isNonBrowser>
            || isPhantomJS
            //</if>
            ) {
                // Firebug friendly, file names are still shown even though they're eval'ed code
                new Function(xhr.responseText + "\n//@ sourceURL=" + fileName)();

                onLoad.call(scope);
            }
            else {
                onError.call(this, "Failed loading synchronously via XHR: '" + url + "'; please " +
                                   "verify that the file exists. " +
                                   "XHR status code: " + status, synchronous);
            }

            // Prevent potential IE memory leak
            xhr = null;
        }
    }
});
*/
Ext.override(Ext.layout.container.Border,{
    slideOutFloatedComponent: function(comp){},
    MY_slideOutFloatedComponent: function(comp) {
    		
        //comp.el.un(comp.panelMouseMon);
        //comp.placeholder.el.un(comp.placeholderMouseMon);
        
        comp.el.slideOut(this.slideDirection[comp.region], comp.slideOutAnim);
        
        /*
        delete comp.slideOutAnim;
        delete comp.panelMouseMon;
        delete comp.placeholderMouseMon;
        */	        
    }
});

Ext.override(Ext.panel.Header, {
    initComponent: function () {
        var me = this;
        me.on('render', function () {
        	if (me.comp && me.comp.name=="registry_form") {
				me.on('click', function(){
	            	if(me.comp.collapsed){
						Util.cmp('registrypanel').getLayout().floatCollapsedPanel(Ext.EventObject,
							Util.cmp('registrypanel panel[name=registry_form]')
						);
	            	} else {
						Util.cmp('registrypanel').getLayout().MY_slideOutFloatedComponent(
							Util.cmp('registrypanel panel[name=registry_form]')
						);
	            	}
				});
        	}
    	}, me);
        me.callOverridden();
    }
});